package design.action.策略;

import design.action.策略.算法1.BigEat;
import design.action.策略.算法2.SuperFly;

public class RedDuck {

    private Duck duck = new Duck();

    {
        //todo 用什么算法完全取决于这里
        duck.setEat(new BigEat());
        duck.setFly(new SuperFly());
    }

    public static void main(String[] args) {
        Duck duck = new RedDuck().duck;
        duck.getEat().eat();
        duck.getFly().fly();
    }
}
